Skip to content

linux, linux-esx: share the canister/.config logic via canister_config.inc - #1673

Open
dcasota wants to merge 1 commit into
vmware:5.0from
dcasota:fix/kernel-shared-canister-config
Open

linux, linux-esx: share the canister/.config logic via canister_config.inc#1673
dcasota wants to merge 1 commit into
vmware:5.0from
dcasota:fix/kernel-shared-canister-config

Conversation

@dcasota

@dcasota dcasota commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Problem

SPECS/linux/linux.spec and SPECS/linux/linux-esx.spec each carry their own copy of the FIPS canister Kconfig handling, and the two copies are not identical: linux.spec has no fips=0 branch.

On a fips=0 build — aarch64 — the # CONFIG_GCC_PLUGIN_MATCH_CANISTER_STRUCTS is not set and # CONFIG_GCC_PLUGIN_PAD_CANISTER_STRUCTS is not set lines are therefore left in .config. Those symbols exist only once the canister plugin patches have been applied, i.e. only when fips=1, so make olddefconfig silently drops them and the check_for_config_applicability.inc diff guard fails %prep.

Change

Move the handling into a single SPECS/linux/canister_config.inc, added as Source5 and %included by both flavours. It covers the three cases in one place: canister_build, canister_usage and fips=0.

The x86_64 FIPS builds keep the .config they had. What is new is the fips=0 cleanup, and that the two flavours can no longer diverge here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf

@aabusair aabusair closed this Sep 2, 2026
@aabusair aabusair reopened this Sep 2, 2026
@dcasota
dcasota force-pushed the fix/kernel-shared-canister-config branch 5 times, most recently from 1e115b3 to a9e54a7 Compare September 9, 2026 11:16
@dcasota
dcasota force-pushed the fix/kernel-shared-canister-config branch 2 times, most recently from d28f018 to 495763b Compare September 11, 2026 19:25
…g.inc

linux.spec and linux-esx.spec implemented the same canister Kconfig handling
in two different idioms, and they disagreed on one constellation.

linux-esx.spec used %if 0%{?fips} / %else, and its %else branch cleaned the
GCC_PLUGIN_{MATCH,PAD}_CANISTER_STRUCTS comments out of .config. linux.spec
instead used two independent %if canister_build / %if canister_usage blocks
with no %else, so when fips=0 nothing ran: the shipped .config kept the
"is not set" comments, make olddefconfig dropped them, and the
check_for_config_applicability.inc diff guard failed %prep. That is the
generic aarch64 kernel - fips is set by %global inside %ifarch, so it is
unconditionally 1 on x86_64 and cannot be overridden with -D, and
acvp_build/kat_build force fips=1 even on aarch64.

Move the three conditional blocks into SPECS/linux/canister_config.inc,
pulled in by both specs as Source5 + %include, the same mechanism both
already use for check_for_config_applicability.inc. Divergence between the
two flavours is now impossible by construction.

linux-esx.spec additionally gains the derived-flag block linux.spec already
had (canister_build=0, canister_usage=fips), nested inside the existing
%if fips so it does not shadow -D. esx never builds a canister - it untars a
prebuilt one - so fips=1 implies canister_usage=1, reproducing the old
branch exactly.

Tested across 112 cells: 2 specs x {x86_64, aarch64} x subrelease {91, 92} x
14 flag combinations of fips / canister_build / canister_usage / acvp_build /
kat_build. All x86_64 cells are byte-identical apart from the release string.
The aarch64 fips=0 cells replace PR#14's broad sed with linux-esx's narrower
pair; the two forms produce byte-identical output on all five shipped config
files, because no config contains a CANISTER_STRUCTS=y form - only the
"is not set" comment form. The esx aarch64 reordering is likewise a no-op:
the canister and jitterentropy seds touch disjoint symbols.

Change-Id: If4107c14d8f15752dff0c0f25c6b4dee504e3041
Signed-off-by: Daniel Casota <dcasota@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants